package losrebellos.papervision3d.view 
{
	import org.papervision3d.cameras.Camera3D;
	import org.papervision3d.render.BasicRenderEngine;
	import org.papervision3d.scenes.Scene3D;

	import flash.events.Event;

	/*
	 *
	 * @author los rebellos - ben@benoitvinay.com
	 *
	 */
	public class SimpleViewport3D extends Viewport3DPlus 
	{
		/*
		 *
		 * CONSTRUCTOR
		 *
		 */
		public function SimpleViewport3D(viewportWidth:Number = 640, viewportHeight:Number = 480, autoScaleToStage:Boolean = false, interactive:Boolean = false, autoClipping:Boolean = true, autoCulling:Boolean = true)
		{
			super(viewportWidth, viewportHeight, autoScaleToStage, interactive, autoClipping, autoCulling);
		}
		
		
		/*
		 * 
		 * CONTENT
		 * 
		 */
		override protected function createScene():void
		{
			_scene = new Scene3D();
		}
		override protected function createCamera():void
		{
			_camera = new Camera3D();
		}
		override protected function createLight():void
		{
//			_light = new PointLight3D(true, true);
//			_light.z = getPixelZ();
//			_scene.addChild(_light);
		}
		override protected function createRenderer():void
		{
			_renderer = new BasicRenderEngine();
		}
		override protected function createContent():void
		{
			
		}

		
		/*
		 * 
		 * RENDERING
		 * 
		 */
		override protected function render(e:Event):void
		{
			_renderer.renderScene(_scene, _camera, this);
		}
	}
}